import Vue from 'vue'
import 'babel-polyfill'
import UmyUi from 'umy-ui'
import 'umy-ui/lib/theme-chalk/index.css'// 引入样式

import 'normalize.css/normalize.css' // a modern alternative to CSS resets

import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './styles/element-variables.scss'

import Avue from '@smallwei/avue'
import '@smallwei/avue/lib/index.css'

// import enLang from 'element-ui/lib/locale/lang/en'// 如果使用中文语言包请默认支持，无需额外引入，请删除该依赖

import '@/styles/index.scss' // global css
import '@/styles/ruoyi.scss' // ruoyi css

import '@/styles/compactness.scss' // compactness css

import App from './App'
import store from './store'
import router from './router'

import './icons' // icon
import './permission' // permission control
import './utils/error-log' // error log
import request from '@/utils/request'
import * as filters from './filters' // global filters
import catchAdmin from '@/components/Catch'
import Pagination from '@/components/Rpagination'
import OrderDetails from '@/components/OrderDetails'
import ComOrderDetails from '@/components/ComOrderDetails'
import ClearOrderDetails from '@/components/ClearOrderDetails'
import LogisticsDetails from '@/components/LogisticsDetails'
import Print from 'vue-print-nb'

// eslint-disable-next-line no-unused-vars
import { parseTime } from '@/utils/index'
// eslint-disable-next-line no-unused-vars
import { getJson, selectJson } from '@/utils/get-json'

Vue.use(Element, {
  size: 'small'// set element-ui default size
  // locale: enLang // 如果使用中文，无需设置，请删除
})

// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

// 后台启动
catchAdmin.boot()

Vue.config.productionTip = false
Vue.prototype.$http = request
Vue.prototype.admin = catchAdmin
Vue.prototype.parseTime = parseTime
Vue.prototype.getJson = getJson
Vue.prototype.selectJson = selectJson

// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('OrderDetails', OrderDetails)
Vue.component('ComOrderDetails', ComOrderDetails)
Vue.component('ClearOrderDetails', ClearOrderDetails)
Vue.component('LogisticsDetails', LogisticsDetails)
Vue.use(Print)
Vue.use(UmyUi)
Vue.use(Avue)

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
